home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / Genie / Projects / Pedestal / Source / Sources / Tasks / PedAgentDoc.cc < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-24  |  748 b   |  46 lines

  1. /*    ==============
  2.  *    PedAgentDoc.hh
  3.  *    ==============
  4.  */
  5.  
  6. #include "PedAgentDoc.hh"
  7. #include "PedDocument.hh"
  8. #include "PedWindow.hh"
  9.  
  10. PedAgentDoc::PedAgentDoc(PedTask *inParent)
  11. : PedAgent(inParent)
  12. {
  13. }
  14.  
  15. PedAgentDoc::~PedAgentDoc()
  16. {
  17. }
  18.  
  19. void
  20. PedAgentDoc::InitWindow()
  21. {
  22.     if (!mWindow) {
  23.         // Note that at the moment, PedWindow() calls SetWindow(),
  24.         // which sets mWindow, so this is redundant (but harmless).
  25.         mWindow = new PedWindow(this);
  26.         // Counterbalance the implicit retain.  (SetWindow will retain for us.)
  27.         mWindow->release();
  28.     }
  29. }
  30.  
  31. bool
  32. PedAgentDoc::OpenWindow()
  33. {
  34.     return PedAgent::OpenWindow();
  35. }
  36.  
  37. bool
  38. PedAgentDoc::CloseWindow()
  39. {
  40.     if (Document()->CloseWindow()) {
  41.         return PedAgent::CloseWindow();
  42.     } else {
  43.         return false;
  44.     }
  45. }
  46.